#include<bits/stdc++.h>
using namespace std;
namespace IO
{
	char buff[1<<21],*p1=buff,*p2=buff;
	char getch(){return p1==p2&&(p2=((p1=buff)+fread(buff,1,1<<21,stdin)),p1==p2)?EOF:*p1++;}
	template<typename T>void read(T &x){char ch=getch();int fl=1;x=0;while(ch>'9'||ch<'0'){if(ch=='-')fl=-1;ch=getch();}while(ch<='9'&&ch>='0'){x=x*10+ch-48;ch=getch();}x*=fl;}
	template<typename T>void read_s(T &x){char ch=getch();while(ch<'a'||ch>'z')ch=getch();while(ch>='a'&&ch<='z'){x+=ch;ch=getch();}}
	template<typename T,typename ...Args>void read(T &x,Args& ...args){read(x);read(args...);}
	char obuf[1<<21],*p3=obuf;
	void putch(char ch) {if(p3-obuf<(1<<21))*p3++=ch;else fwrite(obuf,p3-obuf,1,stdout),p3=obuf,*p3++=ch;}
	char ch[100];
	template<typename T>void write(T x) {if(!x)return putch('0');if(x<0)putch('-'),x*=-1;int top=0;while(x)ch[++top]=x%10+48,x/=10;while(top)putch(ch[top]),top--;}
	template<typename T,typename ...Args>void write(T x,Args ...args) {write(x);write(args...);}
	void put(string s){for(int i=0;i<s.size();i++)putch(s[i]);}
	void flush(){fwrite(obuf,p3-obuf,1,stdout);}
}
using namespace IO;
string s,t;
int n,m;
vector<int>f[100005],from[100005];
int g[100005];
int lst[5];
void print(int x,int p)
{
	if(!x) return;
	print(from[x][p],p-1);
	write(x),putch(' ');
}
int main()
{
	freopen("seq.in","r",stdin);
	freopen("seq.out","w",stdout);
	cin>>s>>t;n=s.size();m=t.size();s='0'+s;t=' '+t;
	for(int i=0;i<=n;i++)
		for(int j=0;j<=m+5;j++) f[i].push_back(0),from[i].push_back(0);
	f[0][0]=1;
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=m;j++)
			if(t[j]==s[i]&&g[j-1]>=lst[(s[i-1]-'0')^1]){f[i][j]=1,from[i][j]=g[j-1];}
		lst[s[i]-'0']=i;
		for(int j=1;j<=m;j++) if(f[i][j]) g[j]=i;
	}
	for(int i=n;i;i--)
	{
		if(f[i][m])
		{
			put("YES\n");print(i,m);
			flush();return 0;
		}
		if(s[i]!=s[n]) break;
	}
	put("NO\n");
	flush();
	return 0;
}
